
#ifndef BACKGROUNDMANAGER_H
#define BACKGROUNDMANAGER_H

#include <vector>
#include "Singleton.h"
#include "Texture.h"
#include "Baby.h"
#include "Food.h"
#include "RenderableEntity.h"
#include "AnimatedEntity.h"
#include "TimeLineEffect.h"
#include "FadeEffect.h"
#include "Prize.h"
#include "defs.h"

#define NUM_CLOUDS      3

class BackgroundManager : public Singleton<BackgroundManager>
{
private:
    RenderableEntity* m_rBackground;
    
    RenderableEntity* m_rBgClouds[NUM_CLOUDS];
    
    TimeLineEffect* m_oFadeIn;
    TimeLineEffect* m_oFadeOut;
    
    // new stuff
    RenderableEntity* m_oBackgrounds[6];
    int m_iCurrentBackground;
    float m_fNextBackgroundCurrentWeight;
    float m_fNextBackgroundWeight;
    int m_iNumberOfBGs;
    
public:
	BackgroundManager();
	~BackgroundManager();
	
public:
	void init();
    void initNew();
    void restartVars();
	void update(float dt);
    void updateBGNew();
	void render();
    void renderNew();
    
    //BG
    void updateBG();
    
    // clouds
    void setupClouds();
    void relocateCloud(int _iIndex);
    
    void fadeIn();
    void fadeOut();
};

#endif
